#-*-coding:utf-8-*-
import unittest,requests
import HTMLTestRunner
import json
import com.note.simplefish.config.ReadConfig as readConfig
class TestWeixinCase(unittest.TestCase):
    def setUp(self):
        r=requests.get("https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=wxd4ec02dab16e5e19&secret=a88e43618535c0c07dc19976ca38f45f")
        self.accessToken=r.json()["access_token"];
        requests.post("http://file.api.weixin.qq.com/cgi-bin/media/upload?access_token="+self.accessToken+"&type=image")
        self.media_id="";
        print(r.json())
        pass
    def test_ocr(self):
        r = requests.get("http://api.weixin.qq.com/cv/ocr/idcard",
                                  {"type": "photo", "img_url": "http://file.api.weixin.qq.com/cgi-bin/media/get?access_token="+self.accessToken+"&media_id=GYyEBVVv2R5o7feG_2AbPpJ5wbCV-iJ-45hZBNvq5V-GOHAMBgtp7VnWFjK0OpDu",
                                   "access_token": self.accessToken})
        print(r.json())
    def tearDown(self):
        pass



